//
//  pch.h
//  muce
//
//  Created by  yunshao on 2018/2/7.
//  Copyright © 2018年  yunshao. All rights reserved.
//

#ifndef pch_h
#define pch_h


#endif /* pch_h */

#import "LPCommonTool.h"
#import "LPShareManager.h"
#import "SVProgressHUD.h"
#import "LPRequestParser.h"
#import <UIImage+YYWebImage.h>
#import <UIButton+YYWebImage.h>
#import <UIImageView+YYWebImage.h>



/** 系统版本 */
#define SYS_VERSION     ([[[UIDevice currentDevice] systemVersion] floatValue])
#define IOS6_OR_LATER   ( SYS_VERSION >= 6.0 )
#define IOS7_OR_LATER   ( SYS_VERSION >= 7.0 )
#define IOS7_1_OR_LATER ( SYS_VERSION >= 7.1 )
#define IOS8_OR_LATER   ( SYS_VERSION >= 8.0 )
#define IOS10_OR_LATER  ( SYS_VERSION >= 10.0 )
#define IOS11_OR_LATER  ( SYS_VERSION >= 11.0 )

/** 超时时间 */
#define DSTimeOut 8.0

//存放本地信息   用户信息  KEY
#define DSUSERKEY  @"userKey"
#define DSHISTERY  @"historyTime"

// 判断是否是Iphone X，iPhone X从状态了开始显示，否则从0开始
#define DSOrginY [LPCommonTool deviceIsIPhoneX] ? [[UIApplication sharedApplication] statusBarFrame].size.height : 0
/** iOS 11 Tab Bar 高度由 49pt 增长为 83pt。 */



/**
 * 强弱引用转换，用于解决代码块（block）与强引用self之间的循环引用问题
 * 调用方式: `@weakify_self`实现弱引用转换，`@strongify_self`实现强引用转换
 *
 * 示例：
 * @weakify_self
 * [obj block:^{
 * @strongify_self
 * self.property = something;
 * }];
 */

#ifndef    weakify_self
#if __has_feature(objc_arc)
#define weakify_self autoreleasepool{} __weak __typeof__(self) weakSelf = self;
#else
#define weakify_self autoreleasepool{} __block __typeof__(self) blockSelf = self;
#endif
#endif
#ifndef    strongify_self
#if __has_feature(objc_arc)
#define strongify_self try{} @finally{} __typeof__(weakSelf) self = weakSelf;
#else
#define strongify_self try{} @finally{} __typeof__(blockSelf) self = blockSelf;
#endif
#endif
/**
 * 强弱引用转换，用于解决代码块（block）与强引用对象之间的循环引用问题
 * 调用方式: `@weakify(object)`实现弱引用转换，`@strongify(object)`实现强引用转换
 *
 * 示例：
 * @weakify(object)
 * [obj block:^{
 * @strongify(object)
 * strong_object = something;
 * }];
 */
#ifndef    weakify
#if __has_feature(objc_arc)
#define weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object;
#else
#define weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object;
#endif
#endif
#ifndef    strongify
#if __has_feature(objc_arc)
#define strongify(object) try{} @finally{} __typeof__(object) strong##_##object = weak##_##object;
#else
#define strongify(object) try{} @finally{} __typeof__(object) strong##_##object = block##_##object;
#endif
#endif


///** 重定义宏（避免输出不完整） */
//#ifdef DEBUG
//#define NSLog(format, ...) printf("Log = %s \n class: <%p %s >\n controller: %s, method: %s, line: %d \n----------------\n", [[NSString stringWithFormat:(format), ##__VA_ARGS__] UTF8String], self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __FUNCTION__, __PRETTY_FUNCTION__, __LINE__)
//#else
//#define NSLog(format, ...)
//#endif



/** 颜色定义 */
#define DSColorWithRGB(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]
#define DSColorWithHex(x)   [UIColor colorWithRed:((float)((x & 0xFF0000) >> 16))/255.0 green:((float)((x & 0xFF00) >> 8))/255.0 blue:((float)(x & 0xFF))/255.0 alpha:1.0]
#define DSNavigationTintColor DSColorWithHex(0Xf7f7f7)
#define DSNavigationBgColor DSColorWithHex(0xe7e7e7)
#define DSFontColor DSColorWithHex(0X7a7a76)                        // 灰色通用内容字体颜色
#define DSLineColor DSColorWithHex(0xcacaca)                        // 分割线颜色
#define DSBackgroundColor DSColorWithHex(0xececef)                  // 分割View颜色（背景颜色）

#define DSFontSize(size) [UIFont systemFontOfSize:size]             // 字体
#define DSFontBoldSize(size) [UIFont boldSystemFontOfSize:size]     // 加粗字体
#define DSAppTintColor           DSColorWithHex(0xffffff)

#define DSBackViewAlpha 0.4         // 背景蒙层透明度


#define DSDevice_W  [UIScreen mainScreen].bounds.size.width  // 设备的宽
#define DSDevice_H  [UIScreen mainScreen].bounds.size.height // 设备的高
#define DSFixedPX(x) ((CGRectGetWidth([UIScreen mainScreen].bounds) * x) / 750)    // 比例缩放（6s）


#define DSBaseUrl   @"http://222.249.163.39:8090/vse-app/"          // 地址

#define ImageUrl                    @"app/startApp"                                //图片地址
#define    LoginApp                 @"app/loginApp"                     //登录
#define    DetailsApp               @"app/detailsApp"                  //测评详情
#define     OwnpaperApp             @"app/ownpaperApp"                   //。
#define     OwnpaperAttachedApp     @"app/ownpaperAttachedApp"
#define     FinishParticipate       @"app/finishParticipate"         //参评是否结束
#define     GetQuestionnaireApp     @"app/getQuestionnaireApp"          //获取做题页面。
#define     SaveOwnpaperApp         @"app/saveOwnpaperApp"              //提交评论
#define     SaveQuestionnaireApp    @"app/saveQuestionnaireApp"         //提交测评答案


typedef enum : NSUInteger {
    clickIndex_detailIntroduce,                 // 详情介绍
   
} clickType;
